home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00394_Interface Hlt Script2.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  2.8 KB  |  82 lines

  1. property iHltsprite, iHowManyButton, iCastHeight, iCastWidth, iEachButtonWidth, iHltpixel, iEachButtonHeight, iFullCast, iSearchPopOut, iHeader, IEachButtonHeightModes
  2. global gHltPixel, gFlashPixel, gModeHighltSprite, gSearchPopOut, gHeaderHere, gHoldSearchInfo, gFindBase, gColorMac, gComputerTypeK, gExtraSpeed, gDefaultENTRYstate, gDefaultENCstate, gHoldEncPixelSprite, gHoldEntPixelSprite, gSearchButton, gDefaultSearchstate, gInputFieldSpr, gDefaultTextstate, gDefaultPixelstate, gBtnHitSND
  3.  
  4. on birth me, pWhichSprite, pHowMany, pcastMem, pWidth
  5.   set iHltsprite to pWhichSprite
  6.   set iHowManyButton to pHowMany + 0.0
  7.   set iEachButtonWidth to pWidth + 0.0
  8.   set iFullCast to pcastMem
  9.   set iHeader to gHeaderHere
  10.   set iHltpixel to gHltPixel
  11.   return me
  12. end
  13.  
  14. on mDumpParams me
  15. end
  16.  
  17. on mHltHor me, pWhichSprite
  18.   puppetSprite(iHltsprite, 1)
  19.   set vMousePos to getAt(the clickLoc, 1)
  20.   set vRelativeClick to vMousePos - the left of sprite iHltsprite
  21.   set vWhere to integer((vRelativeClick / iEachButtonWidth) + 0.4999999)
  22.   if vWhere < 1 then
  23.     set vWhere to 1
  24.   end if
  25.   set whereVer to the top of sprite iHltsprite
  26.   set whereHor to the left of sprite iHltsprite + ((vWhere - 1) * iEachButtonWidth)
  27.   set vwhom to iFullCast + vWhere
  28.   mSwitchHold(me, whereHor, whereVer, vwhom, pWhichSprite)
  29.   return vWhere
  30. end
  31.  
  32. on mHltKeyHor me
  33.   puppetSprite(iHltsprite, 1)
  34.   set vWhere to charToNum(the key)
  35.   if vWhere > 96 then
  36.     set vWhere to vWhere - 96
  37.   else
  38.     set vWhere to vWhere - 64
  39.   end if
  40.   set whereVer to the top of sprite iHltsprite
  41.   set whereHor to the left of sprite iHltsprite + ((vWhere - 1) * iEachButtonWidth)
  42.   set vwhom to iFullCast + vWhere
  43.   mSwitchHold(me, whereHor, whereVer, vwhom, iHltpixel)
  44.   return vWhere
  45. end
  46.  
  47. on mLeaveMode me
  48.   puppetSprite(iHltpixel, 0)
  49.   puppetSprite(iHltsprite, 0)
  50.   puppetSprite(iHeader, 0)
  51.   updateStage()
  52. end
  53.  
  54. on mSwitchCastHlt me, whereHor, whereVer, vwhom
  55.   puppetSprite(gFlashPixel, 1)
  56.   set the locH of sprite gFlashPixel to whereHor
  57.   set the locV of sprite gFlashPixel to whereVer
  58.   set the castNum of sprite gFlashPixel to vwhom
  59.   updateStage()
  60.   puppetSprite(gFlashPixel, 0)
  61. end
  62.  
  63. on mHltfromScripts me, vWhere
  64.   puppetSprite(iHltsprite, 1)
  65.   set whereVer to the top of sprite iHltsprite
  66.   set whereHor to the left of sprite iHltsprite + ((vWhere - 1) * iEachButtonWidth)
  67.   set vwhom to iFullCast + vWhere
  68.   mSwitchHold(me, whereHor, whereVer, vwhom, iHltpixel)
  69. end
  70.  
  71. on mSwitchHold me, whereHor, whereVer, vwhom, whichpixel
  72.   set vIsChanged to not (the puppet of sprite whichpixel) or (the locH of sprite whichpixel <> whereHor) or (the locV of sprite whichpixel <> whereVer)
  73.   if vIsChanged then
  74.     puppetSprite(whichpixel, 1)
  75.     set the locH of sprite whichpixel to whereHor
  76.     set the locV of sprite whichpixel to whereVer
  77.     set the castNum of sprite whichpixel to vwhom
  78.     updateStage()
  79.     hearit(gBtnHitSND)
  80.   end if
  81. end
  82.